#include <iostream>
#include <string>
#include <vector>
using namespace std;

class Solution
{
public:
	int maxEveni(vector<int>& nums)
	{
		int max = 0;
		int index = 0;
		int n = nums.size();
		for (int i = 0; i < n; i++)
		{
			if (nums[i] % 2 == 0 && nums[i] > max)
			{
				max = nums[i];
				index = i;
			}
		}
		return index;
	}

	int minSum(vector<int>& nums, int k)
	{
		int i = maxEveni(nums);

		while (k--)
		{
			nums[i] = nums[i] / 2;
			i = maxEveni(nums);
		}

		int sum = 0;
		int n = nums.size();
		for (int j = 0; j < n; j++)
		{
			sum += nums[j];
		}

		return sum;
	}
};

int main()
{
	int n, k;
	cin >> n >> k;
	vector<int> v;
	int a;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		v.push_back(a);
	}

	cout << Solution().minSum(v, k) << endl;

	return 0;
}




//2.
class Solution2
{
public:
	vector<int> minInterval(vector<int>& nums, int target)
	{
		vector<vector<int>> ret;
		int sum = 0;
		int n = nums.size();
		for (int i = 0; i < n; i++)
		{
			sum += nums[i];
			for (int j = i+1; j < n; j++)
			{
				sum += nums[j];
				if (sum >= target)
				{
					ret.push_back({ i,j });
					break;
				}
			}
			sum = 0;
		}

		int minLen = ret[0][1] - ret[0][0];
		int minSum = nums[ret[0][0]] + nums[ret[0][1]];
		int flag = 0;
		for (int i = 1; i < ret.size(); i++)
		{
			int len = ret[i][1] - ret[i][0];
			int sum = nums[ret[i][0]] + nums[ret[i][1]];
			if (len < minLen)
			{
				minLen = len;
				minSum = sum;
				flag = i;
			}
			else if (len == minLen && sum < minSum)
			{
				minLen = len;
				minSum = sum;
				flag = i;
			}
		}

		return ret[flag];
	}
};


int main2()
{
	int n, x;
	cin >> n >> x;
	vector<int> v;
	int a;
	for (size_t i = 0; i < n; i++)
	{
		cin >> a;
		v.push_back(a);
	}

	vector<int> ret = Solution2().minInterval(v, x);
	for (auto e : ret)
	{
		cout << e << " ";
	}
	cout << endl;

	return 0;
}




//1.
class Solution1
{
public:
	string Shorthand(string& s)
	{
		string ret;
		ret += toupper(s[0]);

		size_t pos = 0;
		while (pos != string::npos)
		{
			pos = s.find(' ', pos + 1);
			if (pos == string::npos)
			{
				break;
			}
			ret += toupper(s[pos + 1]);
		}
		
		return ret;
	}
};

int main1()
{
	/*string s = "College English Test";
	cout << Solution().Shorthand(s) << endl;*/

	string s;
	getline(cin, s);
	cout << s << endl;

	return 0;
}